# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Adria Arrufat <swiftscythe at gmail dot com>

pkgname=ugrep
pkgver=4.3.4
pkgrel=1
pkgdesc='ultra fast grep with interactive TUI, fuzzy search, boolean queries, hexdumps and more'
arch=(loong64 x86_64)
license=(BSD)
url="https://github.com/Genivia/$pkgname"
depends=(bzip2
         lz4
         pcre2
         xz
         zlib
         zstd)
optdepends=('python-pdftotext: to search pdf'
            'antiword: to search doc'
            'pandoc-cli: to search .docx, .epub, and other document formats'
            'perl-image-exiftool: to search meta information embedded in image and video media formats'
            'libreoffice: to search office documents'
            'csvkit: to search spreadsheets'
            'openssl: to search certificates and key files')
_archive="$pkgname-$pkgver"
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('d206a76b3bc103a0c5187f973943cbd8339995a289f62a237a0e658ecb2d0743')

build() {
	cd "$_archive"
	./configure --prefix /usr
}

package() {
	cd "$_archive"
	make DESTDIR="$pkgdir" install
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE.txt
}
